import { Observable } from 'rxjs'

import {
  IRiskControlQueryParams,
  RiskControlScheme,
  RiskControlRule,
  IRiskControlBiz,
} from '@shared/interfaces/risk-control'
import { IGenericPagination } from '@shared/interfaces/pagination'

export abstract class RiskService {
  abstract getList(queryParams: IRiskControlQueryParams): Observable<IGenericPagination<RiskControlScheme>>

  abstract create(body: RiskControlScheme): Observable<boolean>

  abstract getOne(schemeCode: string): Observable<RiskControlScheme>

  abstract update(schemeCode: string, body: RiskControlScheme): Observable<RiskControlScheme>

  abstract delete(schemeCode: string): Observable<boolean>

  abstract getRuleOne(type: string, ruleId: number): Observable<RiskControlRule>

  abstract deleteRule(type: string, ruleId: number): Observable<boolean>

  abstract updateRule(type: string, ruleId: number, body: RiskControlRule): Observable<RiskControlRule>

  abstract getBizs(schemeCode: string): Observable<IRiskControlBiz[]>

  abstract createRule(schemeCode: string, body: RiskControlRule): Observable<boolean>

  abstract freeze(schemeCode: string): Observable<boolean>

  abstract unfreeze(schemeCode: string): Observable<boolean>
}
